

#include <stdio.h>
#include <tp_debug.h>
#include "scps_constants.h"
#include "rs_config.h"
#include "ll.h"
#include "route.h"
#include "other_proto_handler.h"


extern int scps_udp_port1;

GW_ifs gw_ifs = {
  .a = {
    .name={0,},
    .tap_name = {0,},
    .addr_cnt = 0,
    .buf = 0,
    .rbuf = 0,
    .rate = 0,
    .min_rate = 0,
    .ack_delay = 0,
    .cc = 0,
    .mtu=0,
    .smtu=0,
    .ts = 0,
    .snack = 1,
    .ack_behave = -1,
    .nodelay = 0,
    .snack_delay = 0,
    .tcponly = 0,
    .next_hop = 0,
    .encrypt_ipsec_downstream = 0,
    .tap_no_phy = 0,
    .msltimeout = 0,
    .tp_compress = 0,
    .ecbs1 = 0,
    .ecbs1_len = 0,
    .ecbs1_value = {0,},
    .ecbs2 = 0,
    .ecbs2_len = 0,
    .ecbs2_value = {0,},
    .irto = 0,
    .scps_security = 0,
    .layering = 0,
    .overhead = 0,
    .rto_to_persist_ctr = 0,
    .encrypt_pre_overhead = DEFAULT_ENCRYPT_PRE_OVERHEAD,
    .encrypt_block_size = DEFAULT_ENCRYPT_BLOCK_SIZE,
    .encrypt_post_overhead = DEFAULT_ENCRYPT_POST_OVERHEAD,
    .divport = DEF_A_PORT,
    .mss_ff = -1,
    .embargo_fast_rxmit_ctr = 4,
    .nl = NL_DEFAULT,
    .minrto = TP_RTOMIN,
    .maxrto = TP_RTOMAX,
    .maxrto_ctr = TP_TIMEOUT,
    .maxpersist_ctr = TP_MAXPERSIST_CTR,
    .rtopersist_max = TP_RTOPERSIST_MAX,
  },
  .b = {
    .name = {0,},
    .tap_name = {0,},
    .addr_cnt = 0,
    .buf = 0,
    .rbuf = 0,
    .rate = 0,
    .min_rate = 0,
    .ack_delay = 0,
    .cc = 0,
    .mtu = 0,
    .smtu = 0,
    .ts = 0,
    .snack = 1,
    .ack_behave = -1,
    .nodelay = 0,
    .snack_delay = 0,
    .tcponly = 0,
    .next_hop = 0,
    .encrypt_ipsec_downstream = 0,
    .tap_no_phy = 0,
    .msltimeout = 0,
    .tp_compress = 0,
    .ecbs1 = 0,
    .ecbs1_len = 0,
    .ecbs1_value = {0,},
    .ecbs2 = 0,
    .ecbs2_len = 0,
    .ecbs2_value = {0,},
    .irto = 0,
    .scps_security = 0,
    .layering = 0,
    .overhead = 0,
    .rto_to_persist_ctr = 0,
    .encrypt_pre_overhead = DEFAULT_ENCRYPT_PRE_OVERHEAD,
    .encrypt_block_size = DEFAULT_ENCRYPT_BLOCK_SIZE,
    .encrypt_post_overhead = DEFAULT_ENCRYPT_POST_OVERHEAD,
    .divport = DEF_B_PORT,
    .mss_ff = -1,
    .embargo_fast_rxmit_ctr = 4,
    .nl = NL_DEFAULT,
    .minrto = TP_RTOMIN,
    .maxrto = TP_RTOMAX,
    .maxrto_ctr = TP_TIMEOUT,
    .maxpersist_ctr = TP_MAXPERSIST_CTR,
    .rtopersist_max = TP_RTOPERSIST_MAX,
  },
  .c_netstat_interval = 0,
  .c_divert_start_rule = 0,
  .c_divert_insert_rule = 0,
  .c_clust_thresh = 0,
  .c_other_proto_xrate_drop = 0,
  .c_other_proto_non_ip = 0,
  .c_tap_remote_access = 0,
  .c_divport = DEF_C_PORT,
  .c_scps_local_udp_port = SCPS_UDP_PORT,
  .c_scps_remote_udp_port = Other_SCPS_UDP_PORT,
  .c_other_proto_qlen = OTHER_PROTO_QLEN_DEFAULT,
};

short readctr = 0;    /* for testing only */

struct side_conf *rs_aside(void)
{
  return &gw_ifs.a;
}

struct side_conf *rs_bside(void)
{
  return &gw_ifs.b;
}

GW_ifs *get_ifs(void)
{
  return &gw_ifs;
}


